#ifndef VIA_COMMANDS_H__
#define VIA_COMMANDS_H__

#include <windows.h>
#include <TLHELP32.H>

#ifdef COMMANDS_EXPORTS
#define VIACMD_API __declspec(dllexport)
#else
#define VIACMD_API __declspec(dllimport)
#endif

typedef enum VIA_DATATYPE {
	VIA_CHAR,
	VIA_SHORT,
	VIA_INT,
	VIA_LONG,
	VIA_BYTE, 
	VIA_WORD,
	VIA_DWORD,
	VIA_FLOAT,
	VIA_DOUBLE,
	VIA_PVOID
} VIA_DATATYPE;

typedef enum VIA_VSTYPE {
	VIA_DS,	// DevStudio 6
	VIA_VS_2003,	// Visual Studio
	VIA_VS_2005
}VIA_VSTYPE;

#ifdef __cplusplus
extern "C" {
#endif

	VIACMD_API	HANDLE	viaCommandsCreate(IDispatch* pApplication, VIA_VSTYPE type);
	VIACMD_API	void	viaCommandsRelease(HANDLE *pCmds);
	VIACMD_API	BOOL	viaCommandsEvaluateStr(HANDLE pCmds, char* expression, TCHAR* value, int size);
	VIACMD_API	BOOL	viaCommandsEvaluate(HANDLE pCmds, char* expression, PVOID value, VIA_DATATYPE type);

	VIACMD_API	BOOL	viaCommandsReadMemory(HANDLE pCmds, PVOID pDst, PVOID pSrc, int size);
	//VIACMD_API	BOOL	viaCommandsWriteMemory(HANDLE pCmds, PVOID pDst, PVOID pSrc, int size);

	VIACMD_API	LONG	viaCommandsGetVSMainWnd(HANDLE pCmds);
	//VIACMD_API	void	viaCommandsUpdateDebugger(HANDLE pCmds);

#ifdef __cplusplus
}
#endif

#define viaCreateCommands	viaCommandsCreate
#define viaReleaseCommands	viaCommandsRelease
#define viaEvaluateStr		viaCommandsEvaluateStr
#define viaEvaluate			viaCommandsEvaluate
#define viaReadMemory		viaCommandsReadMemory
#define viaWriteMemory		viaCommandsWriteMemory

#endif//VIA_COMMANDS_H__